package club.yuyang.campus2mall.controller;

import club.yuyang.campus2mall.dto.AdMenuDto;
import club.yuyang.campus2mall.entity.AdMenu;
import club.yuyang.campus2mall.service.AdMenuService;
import club.yuyang.campus2mall.utils.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 *@ClassName AdMenuController
 *@Description TODO
 *@Author yuyang
 *@Date 2020/11/30 10:12
 */
@RestController
public class AdMenuController {
    @Resource
    private AdMenuService adMenuService;

    @GetMapping("/menus")
    public Result getMenus(){
        List<AdMenuDto> adMenuDtoList = adMenuService.queryList();
        if (adMenuDtoList != null){
            return new Result(adMenuDtoList,"获取列表成功！","200");
        }else {
            return new Result(null,"获取列表失败！","400");
        }
    }
}
